﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义的tab选项卡</title>
    <style>
        * {margin: 0; padding: 0;}
        .tabs-box {
            height: 38px;
            box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            font-size: 0;
        }
        .tab-item {
            padding: 0 20px;
            line-height: 38px;
            background-color: rgb(242, 245, 250);
            font-size: 14px;
            color: rgb(166, 166, 166);
            display: inline-block;
            cursor: pointer;
            position: relative;
            margin-right: 15px;
            transition: all 0.3s ease;
        }
        .tab-item:hover {
            background-color: #fff;
            color: blue;
            z-index: 5;
        }
        .tab-item::after {
            content: '';
            position: absolute;
            left: 100%;
            top: 0;
            width: 36px;
            height: 100%;
            background-color: inherit;
            clip-path: polygon(0 0, 0 100%, 100% 100%);
        }

        .tab-item .tab-close {
            display: none;
            position: absolute;
            width: 14px;
            height: 14px;
            line-height: 14px;
            border-radius: 50%;
            background: #ccc;
            text-align: center;
            font-size: 12px;
            top: 50%;
            right: 0;
            margin-top: -7px;
        }
        .tab-item:hover .tab-close{
            display: block;
        }
    </style>
</head>
<body>
    <div class="tabs-box">
        <div class="tab-item">
            客户档案
            <span class="tab-close">X</span>
        </div>
        <div class="tab-item">
            房产档案
            <span class="tab-close">X</span>
        </div>
        <div class="tab-item">
            菜单管理
            <span class="tab-close">X</span>
        </div>
    </div>
</body>
</html>